<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Prize extends Model
{
    protected $table = 'prize';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'count', 'chance','rank_id','info','cash','attach_id','order','passwd',
    ];

    protected $hidden = [
        'remember_token',
    ];

    public function prize_rank(){
        return $this->hasOne('App\Models\PrizeRank','id','rank_id');
    }

    public function prizeBo(){
        return $this->belongsTo('App\Models\PrizeRank','rank_id','id');
    }

    public function attach(){
        return $this->hasOne('App\Models\Attachs','id','attach_id');
    }

    public function attachBo(){
        return $this->belongsTo('App\Models\Attachs','attach_id','id');
    }
}
